﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="StringObjectConverter.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Allows properties of type object to automatically assume attribute values entered in the designer are of type string.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.ComponentModel
{
    using System.ComponentModel;
    using System.Globalization;

    /// <summary>
    /// Allows properties of type object to automatically assume attribute values entered in the designer are of type string.
    /// </summary>
    public class StringObjectConverter : TypeConverter
    {
        public override bool CanConvertFrom(ITypeDescriptorContext context, System.Type sourceType)
        {
            return true;
        }

        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            return value;
        }
    }
}